package com.lzx.kafka.consumer;


import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;


@Component
public class KafkaReceiverErro {

	/**
	 * 消费者1
	 * 张俊杰 2021年01月29日 13:13
	 */
	@KafkaListener(topics = "topic1", groupId = "test1")
	public void listen0(ConsumerRecord<String, String> record) {
		System.out.println("我是消费者"+ record.topic()+",我消费的内容是 : " + record.value());
	}

	/**
	 * 消费者2
	 * 张俊杰 2021年01月29日 13:15
	 */
	@KafkaListener(topics = "topic2", groupId = "test1")
	public void listen2(ConsumerRecord<String, String> record) {
		System.out.println("我是消费者"+ record.topic()+",我消费的内容是 : " + record.value());
	}




}
